﻿<%@ Page Language="C#" MasterPageFile="~/Themes/Default/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="openIdLoginContent" ContentPlaceHolderID="MainContent" runat="server">

<h2>Login via OpenID</h2>

<%	var errors = ViewData["errors"] as IList<string>;
    if (errors != null) { %>
<ul class="error">
<% foreach (string error in errors){ %>
    <li><%= Html.Encode(error) %></li>
<% } %>
</ul>
<% } %>

<% using(Html.BeginForm( "Login", "OpenID" )){ %>
<fieldset class="MvcMembership">
	<legend>Login</legend>
	<div><label for="openid_identifier">OpenID Url:</label> <% =Html.TextBox( "openid_identifier" )%></div>
	<div><input type="submit" value="Login" onclick="return starterKit_mvc_membership_validateOpenIdLogin();" /></div>
</fieldset>
<% } %>

<!-- BEGIN ID SELECTOR -->
<!-- //### obtain an OpenID Selector from https://www.idselector.com and place it here to provide users with an easy way to log in with OpenID.
<script type="text/javascript" id="__openidselector" src="https://www.idselector.com/selector/YOUR_ID_HERE" charset="utf-8"></script>
//-->
<!-- END ID SELECTOR -->

<script type="text/javascript">
/* <![CDATA[ */

	function starterKit_mvc_membership_validateOpenIdLogin()
	{

		var identity = document.getElementById('openid_identifier').value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		if( identity.length < 1 )
		{
			alert( 'Please enter your OpenID Url.' );
			document.getElementById('openid_identifier').focus();
			return false;
		}

		return true;

	}

/* ]]> */
</script>

</asp:Content>